<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserSeller extends Model
{
    protected $table='user_seller';
    protected $fillable=[
        'user_id','company','mobile','license','code'
    ];


    /**
     * 新增认证卖家
     * @param array $data
     * @return bool
     */
    static  public function   certification($data=[])
    {
            $re = self::create($data);
            if($re){
                return true;
            }
            return false;
    }

    /**
     * 用户
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function  user()
    {
        return $this->hasOne(User::class,'id','user_id');
    }
}
